<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // {}的本质
    var info = {}
    var info = new Object()
    console.log(info.__proto__)
    console.log(info.__proto__ === Object.prototype)

    // 原型链
    var obj = {
      name: "why",
      age: 18
    }
    // 查找顺序
    // 1.obj上面找
    // 2.obj__proto__上面找
    // 3.obj.__proto__.__proto__ -> null 上面查找(undefined)
    console.log(obj.message)

    obj.__proto__ = {
      message: "aaa"
    }
    console.log(obj.message)

    obj.__proto__ = {}
    obj.__proto__.__proto__ = {
      message: "bbb"
    }
    console.log(obj.message)
    
  </script>
</body>

</html>